package com.wang.test;

import java.util.Date;

import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ListView;
import android.widget.TextView;

import com.wang.ioc.BaseV4FragmentActivity;
import com.wang.ioc.annotation.ViewComponent;
import com.wang.ioc.annotation.ViewContainer;

@SuppressLint("NewApi")
@ViewContainer()
public class SecondActivity extends BaseV4FragmentActivity {
	@ViewComponent(name="textView1")
	private TextView myTextView;
	@ViewComponent(clickEventSource=true)
	private Button button1;
	@ViewComponent(clickEventSource=true)
	private Button button2;
	@ViewComponent(clickEventSource=true)	
	private CheckBox checkBox1;
	private ListView listView1;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.fragment);

//		System.out.println("@@ 新页面 "+new Date().getTime());
//		String[] data=new String[100];
//		for(int i=0;i<data.length;i++){
//			data[i]=i+"个数据项";
//		}
//		ListAdapter adapter=new ListAdapter(this, data);
//		listView1.setAdapter(adapter);

		System.out.println("@@ 新页完 "+new Date().getTime());
		
	}
	
	@Override
	public void setData() {
		System.out.println("@@ 新页面setData "+new Date().getTime());
		String[] data=new String[100000];
		for(int i=0;i<data.length;i++){
			data[i]=i+"个数据项";
		}
		ListAdapter adapter=new ListAdapter(this, data);
		listView1.setAdapter(adapter);
		myTextView.setText("这个是最新的文本内容了");
		System.out.println("@@ 新页完setData "+new Date().getTime());
		super.setData();
	}
	protected Dialog createInitingDialog(){
		ProgressDialog progressDialog = ProgressDialog.show(this, "", "别着急，请等待...", true, false);  
        return progressDialog;
	}
	@Override
	public void onClick(View v) {
		
		
	}
}
